<template>
  <MessageItem :message="item" v-for="item in messages" :key="item" />

  <template v-if="loading">
    <el-icon class="is-loading"><Loading /></el-icon>
    思考中
  </template>
</template>
<script setup>
import MessageItem from './MessageItem.vue'

const props = defineProps({
  messages: Array,
  loading: Boolean,
})
</script>
<style lang="scss" scoped>
.list-enter-active,
.list-leave-active {
  transition: all 0.5s ease;
}
.list-enter-from,
.list-leave-to {
  opacity: 0;
  transform: translateX(-50%);
}
</style>
